home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWBWPat.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.9 KB  |  121 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWBWPat.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWBWPAT_H
  11. #define FWBWPAT_H
  12.  
  13. #ifndef FWPAT_H
  14. #include "FWPat.h"
  15. #endif
  16.  
  17. // ----- Foundation Includes -----
  18.  
  19. #ifndef FWSTDDEF_H
  20. #include "FWStdDef.h"
  21. #endif
  22.  
  23. #ifndef FWPRIMEM_H
  24. #include "FWPriMem.h"
  25. #endif
  26.  
  27. // ----- Macintosh Includes -----
  28.  
  29. #if defined(FW_BUILD_MAC) && !defined(__QUICKDRAW__)
  30. #include <QuickDraw.h>
  31. #endif
  32.  
  33. // ----- Windows Includes -----
  34.  
  35. #if defined(FW_BUILD_WIN) && !defined(_INC_WINDOWS)
  36. #include <windows.h>
  37. #endif
  38.  
  39. #if FW_LIB_EXPORT_PRAGMAS
  40. #pragma lib_export on
  41. #endif
  42.  
  43. //========================================================================================
  44. //    Forward Class Declarations
  45. //========================================================================================
  46.  
  47. class FW_CLASS_ATTR FW_CReadableStream;
  48.  
  49. //========================================================================================
  50. //    CLASS FW_CBWPatternRep
  51. //========================================================================================
  52.  
  53. class FW_CLASS_ATTR FW_CBWPatternRep : public FW_CPatternRep
  54. {
  55.     friend class FW_CLASS_ATTR FW_PPattern;
  56.  
  57. public:
  58.     FW_DECLARE_CLASS
  59.  
  60. //----------------------------------------------------------------------------------------
  61. //    Constructors/Destructors
  62. //
  63. protected:
  64.     FW_CBWPatternRep();
  65.     FW_CBWPatternRep(const FW_BitPattern& bits);
  66.     FW_CBWPatternRep(FW_CReadableStream& stream);
  67.  
  68.     virtual ~FW_CBWPatternRep();
  69.     
  70. //----------------------------------------------------------------------------------------
  71. //    Inherited API
  72. //
  73. public:    
  74.     virtual FW_Boolean        IsEqual(const FW_CGraphicCountedPtrRep* other) const;
  75.     virtual void            Flatten(FW_CWritableStream& archive) const;
  76.  
  77.     virtual FW_PPattern        Copy() const;
  78.  
  79.     virtual FW_Boolean        IsBlack() const;
  80.     
  81.     virtual void             Invert();
  82.     
  83.     virtual void            FlipHorizontaly();
  84.     virtual void            FlipVerticaly();
  85.     
  86.     virtual void            ShiftUp();
  87.     virtual void            ShiftDown();
  88.     virtual void            ShiftLeft();
  89.     virtual void            ShiftRight();    
  90.     
  91.     static void*             Read(FW_CReadableStream& archive);
  92.  
  93. private:
  94.     void                    MoveBitPattern(const void* source, void* destination)
  95.                                 {FW_PrimitiveCopyMemory(source, destination, 8);}
  96.     
  97. //----------------------------------------------------------------------------------------
  98. //    Platform Specific
  99. //
  100. public:
  101. #ifdef FW_BUILD_WIN
  102.     virtual HBRUSH            WinCreatePatternBrush() const;    
  103. #endif
  104.  
  105. #ifdef FW_BUILD_MAC
  106.     virtual void            MacSetInCurPort() const;    
  107. #endif
  108.     
  109. //----------------------------------------------------------------------------------------
  110. //    Data Member
  111. //
  112. private:    
  113.     FW_BitPattern        fBitPattern;        // ODF convention 1:foreground     0:background
  114. };
  115.  
  116. #if FW_LIB_EXPORT_PRAGMAS
  117. #pragma lib_export off
  118. #endif
  119.  
  120. #endif
  121.